package com.itheima.test;

import sun.nio.cs.ext.GBK;

import java.io.*;

public class FileDemo {
    public static void main(String[] args) throws IOException {
  InputStreamReader isr=new InputStreamReader
                (new FileInputStream("zuoye\\c.txt"));
        OutputStreamWriter osw=new OutputStreamWriter
                (new FileOutputStream("zuoye\\c.txt"), "UTF-8");

        osw.write("qwewqqr");
        osw.flush();//刷新内存
        int read = isr.read();
        System.out.println(read);

//        FileOutputStream fos=new FileOutputStream("zuoye\\b.txt");
////        String s="对方感到深深的还是";
////        fos.write(s.getBytes());
//       FileReader fr=new FileReader("zuoye\\a.txt");
//          FileWriter fw=new FileWriter("zuoye\\b.txt");
//
//    int ch;
//    while ((ch=isr.read())!=-1){
//        System.out.println(ch);
//      //  fw.write(ch);
//    }
//        fos.close();
//        fw.close();;
//        fr.close();
        osw.close();
        isr.close();
    }
}
